package com.qf.dto;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RepairDto {
    //维修id
    private Integer id;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    //房屋id
    @NotNull(message="[房屋id]参数输入有误")
    @Min(value=1,message="[房屋id]参数输入有误")
    private Integer houseId;
    //维修状态
    @NotNull(message="[维修状态]参数输入有误")
    @Max(value=1,message="[维修状态]参数输入有误")
    @Min(value=0,message="[维修状态]参数输入有误")
    private Integer repairStatus;
    //维修内容
    //^[\u4e00-\u9fa5a-zA-Z]{5,10}$
    @Pattern(regexp = "^[\u4e00-\u9fa5a-zA-Z]{5,15}$",message="[维修内容]参数必须输入5-15个汉字或字母")
    private String repairMsg;
    //联系电话
    @NotNull(message="参数输入有误")
//    @Length(min = 7,max = 11 ,message = "参数输入有误")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message="[电话号码]参数输入有误")
    private String ownPhone;

}